package com.example.utils;

import lombok.Data;
import org.springframework.context.annotation.Configuration;

import java.util.Random;

@Configuration
@Data
public class NumUtli {
    private String code;

    public static String createCode(int lngth){
        Random random=new Random();
        int n =(int)Math.pow(10,lngth-1);

        String vfgb = n+random.nextInt(9*n) +"";
        return vfgb;
    }

    public String CreCode(int lecth) {
        String cfv = createCode(lecth);
        this.code = cfv;
        return cfv;
    }
}
